# coding=utf-8
class UrlManager(object):
    def __init__(self):
        self.urls = []

    def add_new_url(self, new_url):
        if new_url is None:
            return
        if new_url not in self.urls:
            self.urls.append(new_url)

    def add_new_urls(self, new_urls):
        if new_urls is None or len(new_urls) == 0:
            return

        for url in new_urls:
            self.add_new_url(url)

    def has_new_url(self):
        return len(self.urls) > 0

    def get_new_url(self):
        return self.urls.pop()
